package com.hanggold.captcha.common;

import java.io.File;

/**
 * 验证码默认的一些静态常量.
 *
 * @author <a href="mailto:free@hanggold.com">free</a>
 * @date 2021-09-30 10:06
 * @since 1.0.0
 **/
public class CaptchaConstant {
    
    /**
     * 默认常用的颜色.
     */
    public static final int[][] COLOR = {{0, 135, 255}, {51, 153, 51}, {255, 102, 102}, {255, 153, 0}, {153, 102, 0}, {153, 102, 153},
        {51, 153, 153}, {102, 102, 255}, {0, 102, 204}, {204, 51, 51}, {0, 153, 204}, {0, 51, 102}};
    
    /**
     * 干扰圆数量.
     */
    public static final int DISTURB_CIRCLE_COUNT = Integer.getInteger("soul.captcha.disturb.circle.count", 4);
    
    /**
     * 干扰圆宽度.
     */
    public static final int DISTURB_CIRCLE_WEIGHT = Integer.getInteger("soul.captcha.disturb.circle.weight", 40);
    
    /**
     * 干扰圆高度.
     */
    public static final int DISTURB_CIRCLE_HEIGHT = Integer.getInteger("soul.captcha.disturb.circle.height", 40);
    
    /**
     * 干扰线数量.
     */
    public static final int DISTURB_LINES_COUNT = Integer.getInteger("soul.captcha.disturb.lines.count", 4);
    
    /**
     * 验证码字符数量.
     */
    public static final int CAPTCHA_COUNT = Integer.getInteger("soul.captcha.count", 4);
    
    /**
     * 验证码宽度.
     */
    public static final int CAPTCHA_WEIGHT = Integer.getInteger("soul.captcha.weight", 160);
    
    /**
     * 验证码高度.
     */
    public static final int CAPTCHA_HEIGHT = Integer.getInteger("soul.captcha.height", 60);
    
    /**
     * 验证码字符字体.
     */
    public static final int CAPTCHA_FONT_SIZE = Integer.getInteger("soul.captcha.font.size", 32);
    
    /**
     * 验证码字符字体类型.
     */
    public static final int CAPTCHA_FONT_STYLE = Integer.getInteger("soul.captcha.font.style", 1);
    
    /**
     * 默认的验证码内容.
     */
    public static final String DEFAULT_VALUE = System.getProperty("soul.captcha.value", "soul");
    
    /**
     * gif图片的数量.
     */
    public static final int CAPTCHA_GIF_COUNT = Integer.getInteger("soul.captcha.gif.count", 5);
    
    /**
     * gif图片之间延时时间.
     */
    public static final int CAPTCHA_GIT_DELAY_TIME = Integer.getInteger("soul.captcha.gif.delay.time", 300);
    
    /**
     * 默认生成的字体路径.
     */
    public static final String DEFAULT_FONT_FAMILY_PATH = String.join(File.separator, System.getProperty("soul.font.family",
        System.getProperty("user.dir")), "soul", "font", "family");
    
}
